﻿using System;
using System.Globalization;
using System.Windows.Data;
using OpenLS.Drawing;

namespace OpenLS.Chart.UI.Internals
{
    class ViewModelFactory: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is PieSeries)
                return new PieSeriesViewModel((PieSeries)value);
            if (value is IShape)
                return new ShapedViewModel((IShape) value);
            throw new NotSupportedException();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}